package base.httputils;

import android.app.ProgressDialog;
import android.content.Context;

public class ProgressDialogHttp {
    private static ProgressDialog m_progressBar;
    /**
     *退出登录
     *
     * @param ctx
     */
    public static void showProgressDialog(final Context ctx) {
        if (m_progressBar == null){
            synchronized (ProgressDialogHttp.class) {
                if (m_progressBar == null) {
                    m_progressBar= new ProgressDialog(ctx);
                    m_progressBar.setTitle("请稍等...");
                    m_progressBar.setMessage("获取数据中...");
                    m_progressBar.setCancelable(true);
                    m_progressBar.show();
                }
            }
        }
        if (m_progressBar!=null){
            if (m_progressBar.isShowing()){
            }else {
                m_progressBar.show();
            }
        }
    }
    public static  void disMissDialog(){
        if (m_progressBar!=null){
            m_progressBar.dismiss();
            m_progressBar=null;
        }
    }
}
